﻿
using MongoDB.Bson;
using MongoDB.Driver;

using System;
using System.Collections.Generic;
namespace HBase {
    /**
   *┌────────────────────────────────────────────────┐
   *│　描    述：MongoServer                                                    
   *│　作    者：sgj                                              
   *│　版    本：1.0                                              
   *│　创建时间：2021/6/6 9:58:16                        
   *└────────────────────────────────────────────────┘
   **/
    public interface IMServer {
        void backUp(string key,Object t ,bool force = false);
        T show<T>(string key, String _id);

        BsonDocument show(string key, String name ,String _id);
        void InsertBatch(string key, String className ,List<BsonDocument> log);
        void InsertBatch(string key, string name ,List<object> log);
        void InsertBatch<T>(string key, List<T> log) where T : BaseMongoLog;

        Page<Object> queryPage(string key, String name ,int begin ,FilterDefinition<BsonDocument> filter);
        Page<Object> queryPage(string key, String name ,MongoPageDto param);
        Page<T> queryPage<T>(string key, MongoPageDto dto);
        void saveCode(string connName, String id, Object obj);
        List<BsonDocument> queryAll(string key, string className ,FilterDefinition<BsonDocument> query ,SortDefinition<BsonDocument> builder);

        void save<T>(string connName, T t,String name=null) where T : BaseMongoLog;


        void deleteCollection<T>(string key, FilterDefinition<BsonDocument> query);
    }
}
